﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Design;
using System.ComponentModel;
using System.Windows.Forms;
using System.Windows.Forms.Design;
using UIDesigner.Designers;
using UIDesigner.DesignContainers;

namespace UIDesigner.Design
{
    [System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
    public class ObjectUIDesigner : ParentControlDesigner
    {
        private IComponent m_objComponent;
        private DesignerActionListCollection m_rgActionLists;

        public ObjectUIDesigner()
        {

        }

        public override void DoDefaultAction()
        {
            base.DoDefaultAction();
        }

        public override void Initialize(IComponent component)
        {
            m_objComponent = component;

            base.Initialize(component);
        }

        public void ConfigureHandler(object sender, EventArgs e)
        {
        }

        public override bool CanBeParentedTo(IDesigner parentDesigner)
        {
            return true;
        }

        public override DesignerActionListCollection ActionLists
        {
            get
            {
                if (m_rgActionLists == null)
                {
                    m_rgActionLists = new DesignerActionListCollection();
                    m_rgActionLists.Add(new ObjectUIActionList(this.Component));
                }

                return m_rgActionLists;
            }
        }

        public override DesignerVerbCollection Verbs
        {
            get 
            {
                DesignerVerbCollection rgVerbs = new DesignerVerbCollection();

                rgVerbs.Add(new DesignerVerb("Configure", new EventHandler(ConfigureHandler)));

                return rgVerbs;
            }
        }
    }
}
